package week1;
    import java.util.Scanner;

    public class test3 {
        //青蛙跳台阶的实现
        public static int frog(int n){
            if (n==1||n==2){
                if (n==1){
                    return 1;
                }
                else{
                    return 2;
                }
            } return frog(n-1)+frog(n-2);
        }

        public static void main(String[] args) {
            Scanner sc=new Scanner(System.in);
            System.out.println("请输入青蛙要挑的台阶数：");
            int n= sc.nextInt();
            System.out.println("青蛙跳台阶的方法有"+frog(n)+"种");
        }
    }


